home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / 1.2 / scripts / beveled-pattern-hrule.scm.z / beveled-pattern-hrule.scm
Text File  |  2002-07-08  |  3KB  |  75 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Beveled pattern hrule for web pages
  4. ; Copyright (C) 1997 Federico Mena Quintero
  5. ; federico@nuclecu.unam.mx
  6. ; This program is free software; you can redistribute it and/or modify
  7. ; it under the terms of the GNU General Public License as published by
  8. ; the Free Software Foundation; either version 2 of the License, or
  9. ; (at your option) any later version.
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. ; GNU General Public License for more details.
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.  
  19. (define (script-fu-beveled-pattern-hrule width height pattern)
  20.   (let* ((old-bg-color (car (gimp-palette-get-background)))
  21.      (img (car (gimp-image-new width height RGB)))
  22.      (background (car (gimp-layer-new img width height RGB_IMAGE "Hrule" 100 NORMAL)))
  23.      (bumpmap (car (gimp-layer-new img width height RGBA_IMAGE "Bumpmap" 100 NORMAL))))
  24.     (gimp-image-undo-disable img)
  25.     (gimp-image-add-layer img background -1)
  26.     (gimp-image-add-layer img bumpmap -1)
  27.  
  28.     ; Create pattern layer
  29.  
  30.     (gimp-palette-set-background '(0 0 0))
  31.     (gimp-edit-fill background BG-IMAGE-FILL)
  32.     (gimp-patterns-set-pattern pattern)
  33.     (gimp-bucket-fill background PATTERN-BUCKET-FILL NORMAL 100 0 FALSE 0 0)
  34.  
  35.     ; Create bumpmap layer
  36.  
  37.     (gimp-edit-fill bumpmap BG-IMAGE-FILL)
  38.  
  39.     (gimp-palette-set-background '(127 127 127))
  40.     (gimp-rect-select img 1 1 (- width 2) (- height 2) REPLACE FALSE 0)
  41.     (gimp-edit-fill bumpmap BG-IMAGE-FILL)
  42.  
  43.     (gimp-palette-set-background '(255 255 255))
  44.     (gimp-rect-select img 2 2 (- width 4) (- height 4) REPLACE FALSE 0)
  45.     (gimp-edit-fill bumpmap BG-IMAGE-FILL)
  46.  
  47.     (gimp-selection-none img)
  48.  
  49.     ; Bumpmap
  50.  
  51.     (plug-in-bump-map 1 img background bumpmap 135 45 2 0 0 0 0 TRUE FALSE 0)
  52.  
  53.     (gimp-image-set-active-layer img background)
  54.     (gimp-image-remove-layer img bumpmap)
  55.  
  56.     (gimp-palette-set-background old-bg-color)
  57.     (gimp-image-undo-enable img)
  58.     (gimp-display-new img)))
  59.  
  60.  
  61. (script-fu-register "script-fu-beveled-pattern-hrule"
  62.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Beveled Pattern/Hrule..."
  63.             "Beveled pattern hrule"
  64.             "Federico Mena Quintero"
  65.             "Federico Mena Quintero"
  66.             "July 1997"
  67.             ""
  68.                     SF-ADJUSTMENT _"Width" '(480 5 1500 1 10 0 1)
  69.                     SF-ADJUSTMENT _"Height" '(16 1 100 1 10 0 1)
  70.             SF-PATTERN    _"Pattern" "Wood")
  71.